<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>首页</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="keywords" content="前端社区">
    <meta name="description" content="技术交流社区网站">
    <link rel="stylesheet" href="/static/web/res/layui/css/layui.css">
    <link rel="stylesheet" href="/static/web/res/css/global.css">
</head>
<body>
@extends('Web.common.header')

<div class="fly-panel fly-column">
    <div class="layui-container">
        <ul class="layui-clear">
            <li class="layui-hide-xs layui-this"><a href="/">首页</a></li>
            @if($type)
                @foreach($type as $key => $value)
                    <li><a href="/forumList/{{$value['id']}}">{{$value['title']}}</a></li>
                @endforeach
            @endif
            <!-- 用户登入后显示 -->
            @if(web_user_info())
                <li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block"><span class="fly-mid"></span></li>
                <li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block"><a href="/userIndex">我发表的贴</a>
                </li>
                <li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block"><a href="/userIndex#collection">我收藏的贴</a>
                </li>
            @endif
        </ul>

        <div class="fly-column-right layui-hide-xs">
            {{--<span class="fly-search"><i class="layui-icon"></i></span>--}}
            <a href="/forumCreate" class="layui-btn">发表新帖</a>
        </div>
    </div>
</div>

<div class="layui-container">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md8">
            <div class="fly-panel">
                <div class="fly-panel-title fly-filter"><a>置顶</a></div>
                <ul class="fly-list">
                    @if($top)
                        @foreach($top as $val)
                            <li>
                                <a href="/userHome?id={{$val['get_user']['id']}}" class="fly-avatar">
                                    <img src="{{$val['get_user']['head_img']['url']}}" alt="{{$val['get_user']['name']}}">
                                </a>
                                <h2>
                                    <a class="layui-badge">{{$val['get_type']['title']}}</a>
                                    <a href="/forumDetail/{{$val['id']}}">{{$val['title']}}</a>
                                </h2>
                                <div class="fly-list-info">
                                    <a href="/userHome?id={{$val['get_user']['id']}}" link>
                                        <cite>{{$val['get_user']['name']}}</cite>
                                        @if($val['get_user']['rank'] > 0)
                                            <i class="iconfont icon-renzheng"></i>
                                            <i class="layui-badge fly-badge-vip">VIP{{$val['get_user']['rank']}}</i>
                                        @endif
                                    </a>
                                    <span>{{friendly_date($val['created_at'])}}</span>
                                    <span class="fly-list-nums">
                                        <i class="iconfont icon-pinglun1" title="回答"></i> {{$val['get_comment_count']}}
                                    </span>
                                </div>
                                <div class="fly-list-badge">
                                    {!! $val['tag'] !!}
                                </div>
                            </li>
                        @endforeach
                    @endif
                </ul>
            </div>
            <div class="fly-panel" style="margin-bottom: 0;">
                <div class="fly-panel-title fly-filter">
                    <a href="{{$path}}/0" class="layui-this">综合</a>
                    <span class="fly-mid"></span>
                    <a href="{{$path}}/2">一般</a>
                    <span class="fly-mid"></span>
                    <a href="{{$path}}/3">上品</a>
                    <span class="fly-mid"></span>
                    <a href="{{$path}}/4">精品</a>
                    <span class="fly-filter-right layui-hide-xs">
                        <a href="/forumList?sort=newest" class="layui-this">按最新</a>
                        <span class="fly-mid"></span>
                        <a href="/forumList?sort=host">按热议</a>
                    </span>
                </div>

                <ul class="fly-list">
                    @if($list)
                        @foreach($list as $item)
                            <li>
                                <a href="/userHome?id={{$item['get_user']['id']}}" class="fly-avatar">
                                    <img src="{{$item['get_user']['head_img']['url']}}" alt="{{$item['get_user']['name']}}">
                                </a>
                                <h2>
                                    <a class="layui-badge">{{$item['get_type']['title']}}</a>
                                    <a href="/forumDetail/{{$item['id']}}">{{$item['title']}}</a>
                                </h2>
                                <div class="fly-list-info">
                                    <a href="/userHome?id={{$item['get_user']['id']}}" link>
                                        <cite>{{$item['get_user']['name']}}</cite>
                                        @if($item['get_user']['rank'] > 0)
                                            <i class="iconfont icon-renzheng"></i>
                                            <i class="layui-badge fly-badge-vip">VIP{{$item['get_user']['rank']}}</i>
                                        @endif
                                    </a>
                                    <span>{{friendly_date($item['created_at'])}}</span>
                                    {{--<span class="fly-list-kiss layui-hide-xs" title="悬赏飞吻"><i class="iconfont icon-kiss"></i> 60</span>--}}
                                    @if(!empty($user) && $user['id'] == $item['user_id'] && $item['status'] ==1)
                                        <span class="layui-badge fly-badge-accept">审核中</span>
                                    @endif
                                    @if(!empty($user) && $user['id'] == $item['user_id'] && $item['status'] ==2)
                                        <span class="layui-badge layui-bg-gray">被拒绝</span>
                                    @endif
                                    <span class="fly-list-nums">
                                        <i class="iconfont icon-pinglun1" title="回答"></i> {{$item['get_comment_count']}}
                                    </span>
                                </div>
                                <div class="fly-list-badge">
                                    {!! $item['tag'] !!}
                                </div>
                            </li>
                        @endforeach
                    @endif
                </ul>
                <div style="text-align: center">
                    <div class="laypage-main">
                        <a href="/forumList" class="laypage-next">看看更多</a>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-col-md4">

            {{--<div class="fly-panel">
                <h3 class="fly-panel-title">温馨通道</h3>
                <ul class="fly-panel-main fly-list-static">
                    <li>
                        <a href="http://fly.layui.com/jie/4281/" target="_blank">layui 的 GitHub 及 Gitee (码云)
                            仓库，欢迎Star</a>
                    </li>
                    <li>
                        <a href="http://fly.layui.com/jie/5366/" target="_blank">
                            layui 常见问题的处理和实用干货集锦
                        </a>
                    </li>
                    <li>
                        <a href="http://fly.layui.com/jie/4281/" target="_blank">layui 的 GitHub 及 Gitee (码云)
                            仓库，欢迎Star</a>
                    </li>
                    <li>
                        <a href="http://fly.layui.com/jie/5366/" target="_blank">
                            layui 常见问题的处理和实用干货集锦
                        </a>
                    </li>
                    <li>
                        <a href="http://fly.layui.com/jie/4281/" target="_blank">layui 的 GitHub 及 Gitee (码云)
                            仓库，欢迎Star</a>
                    </li>
                </ul>
            </div>--}}

{{--            <div class="fly-panel fly-signin">
                <div class="fly-panel-title">
                    签到
                    <i class="fly-mid"></i>
                    <a href="javascript:;" class="fly-link" id="LAY_signinHelp">说明</a>
                    <i class="fly-mid"></i>
                    <a href="javascript:;" class="fly-link" id="LAY_signinTop">活跃榜<span class="layui-badge-dot"></span></a>
                    <span class="fly-signin-days">已连续签到<cite>16</cite>天</span>
                </div>
                <div class="fly-panel-main fly-signin-main">
                    <button class="layui-btn layui-btn-danger" id="LAY_signin">今日签到</button>
                    <span>可获得<cite>5</cite>飞吻</span>

                    <!-- 已签到状态 -->
                    <!--
                    <button class="layui-btn layui-btn-disabled">今日已签到</button>
                    <span>获得了<cite>20</cite>飞吻</span>
                    -->
                </div>
            </div>--}}

            <div class="fly-panel fly-rank fly-rank-reply">
                <h3 class="fly-panel-title">回贴榜</h3>
                <dl>
                    <!--<i class="layui-icon fly-loading">&#xe63d;</i>-->
                    @foreach($reply as $r)
                    <dd>
                        <a href="/userHome?id={{$r['user_id']}}">
                            <img src="{{$r['get_user']['head_img']['url']}}"><cite>{{$r['get_user']['name']}}</cite><i>{{$r['total']}}次回答</i>
                        </a>
                    </dd>
                    @endforeach
                </dl>
            </div>

            <dl class="fly-panel fly-list-one">
                <dt class="fly-panel-title">最近热议</dt>
                @foreach($host as $h)
                <dd>
                    <a href="/forumDetail/{{$h['id']}}">{{$h['title']}}</a>
                    <span><i class="iconfont icon-pinglun1"></i> {{$h['get_comment_count']}}</span>
                </dd>
                @endforeach
            </dl>

            {{--<div class="fly-panel">
                <div class="fly-panel-title">
                    这里可作为广告区域
                </div>
                <div class="fly-panel-main">
                    <a href="http://layim.layui.com/?from=fly" target="_blank" class="fly-zanzhu"
                       time-limit="2017.09.25-2099.01.01" style="background-color: #5FB878;">LayIM 3.0 - layui 旗舰之作</a>
                </div>
            </div>--}}

{{--            <div class="fly-panel fly-link">
                <h3 class="fly-panel-title">友情链接</h3>
                <dl class="fly-panel-main">
                    <dd><a href="http://www.layui.com/" target="_blank">layui</a>
                    <dd>
                    <dd><a href="http://layim.layui.com/" target="_blank">WebIM</a>
                    <dd>
                    <dd><a href="http://layer.layui.com/" target="_blank">layer</a>
                    <dd>
                    <dd><a href="http://www.layui.com/laydate/" target="_blank">layDate</a>
                    <dd>
                    <dd>
                        <a href="mailto:xianxin@layui-inc.com?subject=%E7%94%B3%E8%AF%B7Fly%E7%A4%BE%E5%8C%BA%E5%8F%8B%E9%93%BE"
                           class="fly-link">申请友链</a>
                    <dd>
                </dl>
            </div>--}}

        </div>
    </div>
</div>

@extends('Web.common.footer')

</body>
</html>